var appData = getApp().globalData,
app = getApp(),
Money = 0;
Page({
  data: {
    info: []
  },
  tap: function(e) {
    var f = this.data.info;
    console.log(e)
    for (let i = 0; i < f.length; i++) {
      if (e.currentTarget.id == f[i].id) {
        if (Money) app.modal('详细信息',
          '赏金券邀请码：' + f[i].id +
          '\n顾客手机：' + f[i].user.phone +
          '\n创建时间：' + f[i].origin_time +
          '\n赏金券发放人数：' + f[i].giv_num +
          '\n赏金券实际兑换人数：' + f[i].inv_num 
        );
        else app.modal( '详细信息',
          '优惠券编号：' + f[i].id +
          '\n邀请码：' + f[i].share_id +
          '\n来自好友：' + f[i].nick +
          '\n顾客手机：' + f[i].user.phone +
          '\n领取时间：' + f[i].date
        )
      }
    }
  },
  onLoad: function(op) {
    if (op.path == 'record_money') Money = 1;
    else Money = 0;
    app.request('admin/' + op.path, {name: appData.admin.name}, '查询中').then((info) => {
      console.log(info.name, info.data);
      this.setData({ info: info.data });
    })
    
  },

})